home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / SCSI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  3.9 KB  |  129 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Sunday, September 15, 1991 at 8:41 PM
  5.  SCSI.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1986-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __SCSI__
  16. #define __SCSI__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22.  
  23. enum {
  24.  
  25.  scInc = 1,
  26.  scNoInc = 2,
  27.  scAdd = 3,
  28.  scMove = 4,
  29.  scLoop = 5,
  30.  scNop = 6,
  31.  scStop = 7,
  32.  scComp = 8,
  33.  scCommErr = 2,                        /*communications error, operation timeout*/
  34.  scArbNBErr = 3,                    /*arbitration timeout waiting for not BSY*/
  35.  scBadParmsErr = 4,                    /*bad parameter or TIB opcode*/
  36.  scPhaseErr = 5,                    /*SCSI bus not in correct phase for attempted operation*/
  37.  scCompareErr = 6,                    /*data compare error*/
  38.  scMgrBusyErr = 7,                    /*SCSI Manager busy */
  39.  scSequenceErr = 8,                    /*attempted operation is out of sequence*/
  40.  scBusTOErr = 9,                    /*CPU bus timeout*/
  41.  scComplPhaseErr = 10,                /*SCSI bus wasn't in Status phase*/
  42.  sbSIGWord = 0x4552,
  43.  pMapSIG = 0x504D
  44. };
  45.  
  46. struct Block0 {
  47.  unsigned short sbSig;                /*unique value for SCSI block 0*/
  48.  unsigned short sbBlkSize;            /*block size of device*/
  49.  unsigned long sbBlkCount;            /*number of blocks on device*/
  50.  unsigned short sbDevType;            /*device type*/
  51.  unsigned short sbDevId;            /*device id*/
  52.  unsigned long sbData;                /*not used*/
  53.  unsigned short sbDrvrCount;        /*driver descriptor count*/
  54.  unsigned long ddBlock;                /*1st driver's starting block*/
  55.  unsigned short ddSize;                /*size of 1st driver (512-byte blks)*/
  56.  unsigned short ddType;                /*system type (1 for Mac+)*/
  57.  unsigned short ddPad[243];            /*ARRAY[0..242] OF INTEGER; not used*/
  58. };
  59.  
  60. typedef struct Block0 Block0;
  61.  
  62. struct Partition {
  63.  unsigned short pmSig;                /*unique value for map entry blk*/
  64.  unsigned short pmSigPad;            /*currently unused*/
  65.  unsigned long pmMapBlkCnt;            /*# of blks in partition map*/
  66.  unsigned long pmPyPartStart;        /*physical start blk of partition*/
  67.  unsigned long pmPartBlkCnt;        /*# of blks in this partition*/
  68.  unsigned char pmPartName[32];        /*ASCII partition name*/
  69.  unsigned char pmParType[32];        /*ASCII partition type*/
  70.  unsigned long pmLgDataStart;        /*log. # of partition's 1st data blk*/
  71.  unsigned long pmDataCnt;            /*# of blks in partition's data area*/
  72.  unsigned long pmPartStatus;        /*bit field for partition status*/
  73.  unsigned long pmLgBootStart;        /*log. blk of partition's boot code*/
  74.  unsigned long pmBootSize;            /*number of bytes in boot code*/
  75.  unsigned long pmBootAddr;            /*memory load address of boot code*/
  76.  unsigned long pmBootAddr2;            /*currently unused*/
  77.  unsigned long pmBootEntry;            /*entry point of boot code*/
  78.  unsigned long pmBootEntry2;        /*currently unused*/
  79.  unsigned long pmBootCksum;            /*checksum of boot code*/
  80.  unsigned char pmProcessor[16];        /*ASCII for the processor type*/
  81.  unsigned short pmPad[188];            /*512 bytes long currently unused*/
  82. };
  83.  
  84. typedef struct Partition Partition;
  85.  
  86. struct SCSIInstr {
  87.  unsigned short scOpcode;
  88.  unsigned long scParam1;
  89.  unsigned long scParam2;
  90. };
  91.  
  92. typedef struct SCSIInstr SCSIInstr;
  93.  
  94.  
  95. #ifdef __cplusplus
  96. extern "C" {
  97. #endif
  98. pascal OSErr SCSIReset(void)
  99.  = {0x4267,0xA815}; 
  100. pascal OSErr SCSIGet(void)
  101.  = {0x3F3C,0x0001,0xA815}; 
  102. pascal OSErr SCSISelect(short targetID)
  103.  = {0x3F3C,0x0002,0xA815}; 
  104. pascal OSErr SCSICmd(Ptr buffer,short count)
  105.  = {0x3F3C,0x0003,0xA815}; 
  106. pascal OSErr SCSIRead(Ptr tibPtr)
  107.  = {0x3F3C,0x0005,0xA815}; 
  108. pascal OSErr SCSIRBlind(Ptr tibPtr)
  109.  = {0x3F3C,0x0008,0xA815}; 
  110. pascal OSErr SCSIWrite(Ptr tibPtr)
  111.  = {0x3F3C,0x0006,0xA815}; 
  112. pascal OSErr SCSIWBlind(Ptr tibPtr)
  113.  = {0x3F3C,0x0009,0xA815}; 
  114. pascal OSErr SCSIComplete(short *stat,short *message,unsigned long wait)
  115.  = {0x3F3C,0x0004,0xA815}; 
  116. pascal short SCSIStat(void)
  117.  = {0x3F3C,0x000A,0xA815}; 
  118. pascal OSErr SCSISelAtn(short targetID)
  119.  = {0x3F3C,0x000B,0xA815}; 
  120. pascal OSErr SCSIMsgIn(short *message)
  121.  = {0x3F3C,0x000C,0xA815}; 
  122. pascal OSErr SCSIMsgOut(short message)
  123.  = {0x3F3C,0x000D,0xA815}; 
  124. #ifdef __cplusplus
  125. }
  126. #endif
  127.  
  128. #endif
  129.